#ifndef TD_HEALTH_BAR_H_
#define TD_HEALTH_BAR_H_

/************************************************************************/
/* SDL                                                                  */
/************************************************************************/
#include "SDL/SDL.h"

/************************************************************************/
/* PROJECT                                                              */
/************************************************************************/

/************************************************************************/
/* Core                                                                 */
/************************************************************************/
#include "Core/RectangleShape.h"

/************************************************************************/
/* GUI                                                                  */
/************************************************************************/
#include "GUI/Bars/BaseBar.h"


using namespace TD_Core;

namespace TD_GUI {

	class HealthBar : public BaseBar {

		static const unsigned int backgroundOffset;

		float m_currHealth;


		void update(const unsigned int deltaTime);

	public:

		/************************************************************************/
		/* ctors and dtors					                                    */
		/************************************************************************/
		//Default constructor
		explicit HealthBar();

		//Copy constructor
		explicit HealthBar(const HealthBar &rhs);

		//Assignment constructor
		HealthBar& operator=(const HealthBar &rhs);

		//Initialization constructor
		explicit HealthBar(const Coord2D & barPosition, const Coord2D & barSize, 
			Color foregroundColor = Color::GREEN, Color backgroundColor = Color::BLACK);

		//Destructor
		~HealthBar();


		/************************************************************************/
		/* Access functions                                                     */
		/************************************************************************/
		inline void setHealth(float health) {
			m_currHealth = health;
		}

		inline float getHealth() const {
			return(m_currHealth);
		}

		/************************************************************************/
		/* Rendering functions                                                  */
		/************************************************************************/
		void render(SDL_Surface *const g_destSurface, unsigned int deltaTime);

	};
}
#endif